<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="userManager.signinRedirect()">button</button>
    <script src="js/oidc-client.js"></script>
    <script>
        //请把该页放到和identity同一个站点里，防止跨域，并且确定identityserver端配置了重定向地址
        const host = location.host;
        const settings = {
            authority: `http://${host}`,
            client_id: "ddck",
            client_secret: "secret",
            redirect_uri: `http://${host}/oidc-callback.html`,
            post_logout_redirect_uri: `http://${host}/oidc-callback.html`,
            response_type: "code",
            scope: "modify control monitor openid profile",
            automaticSilentRenew: true,
            includeIdTokenInSilentRenew: true,
            userStore: new WebStorageStateStore({
                prefix: 'ddck'
            })
        }
        const userManager = new UserManager(settings);
        //userManager.signinRedirect();
    </script>
</body>
</html>